public class TestDemo {
    public static void main(String[] args) {
        MyArraylist myArraylist = new MyArraylist();
        myArraylist.add(1);
        myArraylist.add(2);
        myArraylist.add(3);
        myArraylist.add(4);
        myArraylist.add(5);
        myArraylist.add(6);
        try {
            myArraylist.add(0,666);
        } catch (IndexException e) {
            e.printStackTrace();
        }
        try {
            System.out.println(myArraylist.get(4));
        }catch (IndexException e) {
            e.printStackTrace();
        }
        myArraylist.remove(3);
        myArraylist.display();
    }
}
